package com.cake21.test.webtest.page;

import java.util.List;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;

public class Cake {
	
	WebDriver driver;
	
	@FindBy(id="op_product_zoom")
	private WebElement imageURL;
	@FindBy(css=".spec-attr")
	private List<WebElement> specList;
	@FindBy(id="IDproductbuynow")
	private WebElement buyBtn;
	@FindBy(id="IDproductaddtocart")
	private WebElement cartBtn;
	
	public Cake(WebDriver driver)
	{
		this.driver = driver;
		PageFactory.initElements(driver, this);
		System.out.println("Spec Count: " + specList.size());
		
	}
	
	public String getTitle()
	{
		return driver.getTitle();
	}
	
	public CheckOut goCheckOut()
	{
		
		this.buyBtn.click();
		return new CheckOut(driver);
	}

}
